<template>
    <el-header>
        <div class="l-content">
            <el-button size ='middle' plain @click = "change">
                <el-icon :size="20">
                    <Menu />
                </el-icon>
            </el-button>
        </div>
        <div class="r-content">
            <el-dropdown>
    <span class="el-dropdown-link">
     <img class="user" src='../assets/images/touxiang.jpg'>
    </span>
    <template #dropdown>
      <el-dropdown-menu>
        <el-dropdown-item @click="back()">退出</el-dropdown-item>
      </el-dropdown-menu>
    </template>
  </el-dropdown>
        </div>
    </el-header>  
  </template>
  <script>
import { useRouter } from 'vue-router';

export default {
  setup() {
    const router = useRouter();

    const change = () => {
      router.push('/');
    };

    const back = () =>{
      router.push("/login");
    }



    return {
        change,
      back
    };
  },
  methods:{
    // back(){
    //   console.log(1)
    //   router.push("login");
    // }
  }
};
  </script>
<style lang="less" scoped>
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
    .r-content {
        .user {
            width: 40px;
            height: 40px;
            border-radius: 50%;
        }
    }

</style>
